package de.gameduell.framework.util {
	import de.polygonal.ds.Set;

	/**
	 * @author cbra
	 */
	public class ArrayUtil {
		
		public static function convertToSet(array:Array):Set{
			var convertedSet:Set = new Set();
			for(var i:* in array){
				convertedSet.set(array[i]);
			}
			return convertedSet;
		}
		
		public static function getRandomEntry(array:Array):Object{
			var randomIndex:int = Math.round(Math.random() * (array.length - 1));
			return array[randomIndex];	
		}
		
		public static function randomSort(a:Object, b:Object):Number {
			a;b;
			if(Math.random() > 0.5) {
				return 1;
			} else {
				return -1;
			} 
		}
		
		
	}
}
